<?php include_once("module/include/analyticstracking.php") ?>
<?
$row =2;
$col = 4;

$cat = 0;
if($_REQUEST['cat']!='') $cat=killInjection($_REQUEST['cat']);

$p=0;
if ($_REQUEST['p']!='') $p=$_REQUEST['p'];
$sql = "select * from tbl_product where lang='".$_lang."' and id in (select product_id from tbl_product_new where status=0 order by sort,date_added desc) limit ".$row*$col*$p.",".$row*$col;
$result = @mysql_query($sql,$conn);

$total = countRecord("tbl_product_new","status=0 and lang='".$_lang."'");
if($total==0){
?>
<table align="center" cellSpacing="0" cellPadding="0" width="100%" border="0">
	<tr><td height="10"></td></tr>
	<tr>
		<td align="center">
			<font color="#FF0000"><?=$_lang=="vn"?'Sản phẩm đang cập nhật !':'Products are being updated !'?></font>
		</td>
	</tr>
	<tr><td height="20"></td></tr>
</table>
<?
}else{
?>

<table align="center" cellSpacing="0" cellPadding="0" width="100%" border="0">
<?
for($i=0; $i<$row; $i++){
?>
	<tr>
		
		<td align="center" valign="top" style="padding-left:6px; padding-right:6px;">
<?
	for($j=0; $j<$col&&$products=mysql_fetch_assoc($result); $j++){
		$pro = getRecord("tbl_product","id=".$products['id'])?>
		
		<table width="25%" border="0" style="float:left" cellpadding="0" cellspacing="0">
        
          <tr>
         
			
			  <td width="100%" align="center" style=" border-bottom:1px #666666 dotted; border-right:1px #666666 dotted; padding:10px 7px 7px 7px;">
				
				<table width="100%" border="0" cellspacing="0" cellpadding="0">
                      <tr>
                        <td align="center" style="border:1px #CCCCCC solid; padding:4px;"><a title="khohangtot| do gia dung" href="./detail/<?=$pro['id']?>.htm" class="orange-text-regular"><img title="khohangtot| do gia dung" src="<?=$pro['image']?>" width="150" height="100" border="0"/></a></td>
                      </tr>
                      <tr>
						<td align="left" height="25" class="style15"><?=$pro['name']?></td>
                      </tr>
                      <tr>
                       <td align="left" class="style3">
                          <?=$pro['detail_short']?></td>
                      </tr>
					  <tr>
                                <td align="right" style="padding-top:10px;"><a title="khohangtot| do gia dung" href="./detail/<?=$pro['id']?>">.htm<img title="khohangtot| do gia dung" src="images/button_1.jpg" width="69" height="19" border="0" /></a></td>
                              </tr>
                  </table>
				</td>
                      </tr>
          </table>
<?
}
while($j<$col){
	echo "";
	$j=$j+1;
}
?>
		</td>
	</tr>
<? }?>
</table>


<? }?>
<?
		session_register('cat1');
		$_SESSION['cat1'] = $cat;?>